﻿using System;
using System.Collections.Generic;
using System.Text;
using EnCor.Hosting;
using EnCor.ObjectBuilder;
using System.Configuration;

namespace EnCor.Wcf.Hosting
{
    public class WcfHostConfig : FacadeHostConfiguration, IAssembler<FacadeHost, FacadeHostConfiguration>
    {
        [ConfigurationProperty("innerBaseAddress")]
        public string InnerBaseAddress
        {
            get
            {
                return (string)this["innerBaseAddress"];
            }
        }
        #region IAssembler<FacadeHost,FacadeHostConfiguration> Members

        public FacadeHost Assemble(IBuilderContext context, FacadeHostConfiguration objectConfiguration)
        {
            WcfHostConfig config = objectConfiguration as WcfHostConfig;
            if (config == null)
            {
                throw new NotSupportedException(string.Format("The config is not WcfHostConfig : {0}", objectConfiguration));
            }
            //WcfHost host = new WcfHost(new Uri(config.Endpoint),new Uri(config.InnerBaseAddress), config.Services);
            //return host;
            throw new NotImplementedException();
        }

        #endregion
    }
}
